<script type="text/javascript">
function SelectAllCheckboxes(chk) {
	$('#list_table >tbody >tr >td:nth-child(1)').find("input:checkbox").attr('checked', chk.checked);
}
</script>

<?php echo form_open($this->uri->uri_string(), 'class="main_cont1"'); ?>
<?php echo $toolbar?>
<table border="0" class="table table-striped table-bordered mediaTable activeMediaTable" id="list_table">
	<thead>
		<tr>
			<th class="first"><input type="checkbox" onclick="SelectAllCheckboxes(this);" value="" id="check_nav"/></th>
			<th><?php echo lang('role_name_label');?></th>
			<th><?php echo lang('role_description_label');?></th>
			<th><?php echo lang('role_parent_id_label');?></th>
			<th><span><?php echo lang('role_actions_label');?></span></th>
		</tr>
	<thead>
	<tbody>
	<?php if (!empty($roles)) { 
		$i = 0;
	 	foreach ($roles as $member){ ?>
		<tr class="row_<?php echo $i; ?>">
			<td><input type="checkbox" name="action_to[]" value="<?php echo  $member->id; ?>" /></td>
			<td><?php echo anchor('admin/authorizations/admin_roles/edit/' . $member->id, $member->name); ?></td>
			<td><?php echo $member->description; ?></td>
			<td><?php echo $member->parent_id; ?></td>
			<td>
				<?php echo  anchor('admin/authorizations/admin_roles/editUsers/' . $member->id, lang('role_edit_user_label')); ?> |
				<?php echo  anchor('admin/authorizations/admin_resources/index/' . $member->name, lang('role_edit_resource_label')); ?>
			</td>
		</tr>
		<?php 
			if ($i == 0) $i = 1;
			else $i = 0; 
	 	} 
		?>
	<?php }?>
	</tbody>	
</table>
<?php echo form_close(); ?>
